package com.itheima.controller;

import com.itheima.mapper.EmpMapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.Result;
import com.itheima.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//员工管理控制器
@RestController
public class EmpController {

    @Autowired
    public EmpService empService;

    @GetMapping("/emps")
    public Result sb() {
        List<Emp> list1 = empService.sb();
        return Result.success(list1);
    }
    @DeleteMapping("/emps/{ids}")
    public Result nt(@PathVariable Integer id){
        List<Emp> list2=empService.nt(id);
        return Result.success(list2);
    }

    @PostMapping("/emps")
    public Result rb(){
        List<Emp> list3=empService.rb();
        return Result.success(list3);
    }
    @GetMapping("/emps/{id}")
    public Result bis(@PathVariable Integer id){
        List<Emp> list4=empService.bis(id);
        return Result.success(list4);


    }

}